<html>
<head><meta charset="utf-8"><title>weird-query-stacktrace · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/weird-query-stacktrace.html">weird-query-stacktrace</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="136099268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/weird-query-stacktrace/near/136099268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/weird-query-stacktrace.html#136099268">(Oct 19 2018 at 09:09)</a>:</h4>
<p>I have just seen that the following query backtrace (or variants of it) are super common:</p>



<a name="136099272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/weird-query-stacktrace/near/136099272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/weird-query-stacktrace.html#136099272">(Oct 19 2018 at 09:09)</a>:</h4>
<p>(deleted)</p>



<a name="136099274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/weird-query-stacktrace/near/136099274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/weird-query-stacktrace.html#136099274">(Oct 19 2018 at 09:09)</a>:</h4>
<div class="codehilite"><pre><span></span>#0 [const_eval] const-evaluating `&lt;std::collections::VecDeque&lt;A&gt; as std::cmp::PartialEq&lt;&amp;&#39;b mut [B; _]&gt;&gt;::{{constant}}`
#1 [evaluate_obligation] evaluating trait selection obligation `_: std::cmp::PartialEq&lt;_&gt;`
#2 [typeck_tables_of] processing `X`
#3 [mir_built] processing `X`
#4 [unsafety_check_result] processing `X`
#5 [mir_const] processing `X`
#6 [mir_const_qualif] processing `X`
  --&gt; /home/oliver/Projects/rust/rust/src/test/ui/consts/const-integer-bool-ops.rs:18:18
   |
LL | const ARR: [i32; X] = [99; 34];
   |                  ^
#7 [mir_const_qualif] processing `ARR::{{constant}}`
#8 [const_eval] const-evaluating `ARR::{{constant}}`
#9 [check_item_well_formed] processing `ARR`
</pre></div>



<a name="136099276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/weird-query-stacktrace/near/136099276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/weird-query-stacktrace.html#136099276">(Oct 19 2018 at 09:09)</a>:</h4>
<p>(deleted)</p>



<a name="136099360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/weird-query-stacktrace/near/136099360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/weird-query-stacktrace.html#136099360">(Oct 19 2018 at 09:10)</a>:</h4>
<p>So for evaluating an array length, we are out of some reason computing obligations about array equality</p>



<a name="136099402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/weird-query-stacktrace/near/136099402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/weird-query-stacktrace.html#136099402">(Oct 19 2018 at 09:11)</a>:</h4>
<p>I just feel like that is wrong, considering <code>X</code> is defined as <code>const X: usize = 42 &amp;&amp; 39;</code></p>



<a name="136099411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/weird-query-stacktrace/near/136099411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/weird-query-stacktrace.html#136099411">(Oct 19 2018 at 09:12)</a>:</h4>
<p>(yes that is an error, it's from a ui test)</p>



<a name="136101806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/weird-query-stacktrace/near/136101806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/weird-query-stacktrace.html#136101806">(Oct 19 2018 at 10:08)</a>:</h4>
<p>are you referring to the <code>#0</code> entry?</p>



<a name="136101813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/weird-query-stacktrace/near/136101813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/weird-query-stacktrace.html#136101813">(Oct 19 2018 at 10:09)</a>:</h4>
<p>sounds like the problem is that the trait obligation is "underconstrained" and the trait solver goes crazy looking at impls...</p>



<a name="136102477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/weird-query-stacktrace/near/136102477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/weird-query-stacktrace.html#136102477">(Oct 19 2018 at 10:24)</a>:</h4>
<p>hm. ok, I'll try to reproduce with successfully compiling code, makes sense that erroneous code might do weird things</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>